/*
 * Patient.java
 */
package edu.gatech.oad.user;

import java.util.Set;
import java.util.HashSet;
import edu.gatech.oad.schedule.Appointment;
import edu.gatech.oad.records.PatientHistory;

public class Patient extends User {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private String billingInformation;
	
	private PatientHistory patientHistory;
	
	private final Set<Appointment> appointments = new HashSet<Appointment>();
	
	public Patient(String username) {
		this(username, null);
	}
	
	public Patient(String username, String password) {
		super(username, password);
		this.patientHistory = new PatientHistory(this);
	}
	
	public String getBillingInformation() {
		return billingInformation;
	}
	
	public void setBillingInformation(String billingInformation) {
		this.billingInformation = billingInformation;
	}
	
	public PatientHistory getPatientHistory() {
		return this.patientHistory;
	}
	
	public void setPatientHistory(PatientHistory patientHistory) {
		this.patientHistory = patientHistory;
	}
	
	public Set<Appointment> getAppointments() {
		return this.appointments;
	}
	
	public void scheduleAppointment(Appointment appointment) {
		assert appointment.getPatient() == null;
		appointment.setPatient(this);
		this.appointments.add(appointment);
	}
	
	public String toString() {
		return "Patient: Billing Information - " + this.billingInformation + 
			"; Patient History - " + this.patientHistory + "; " +
			super.toString();
	}
	
}
